package com.glfx;


import com.github.houbb.opencc4j.util.ZhConverterUtil;
import com.glfx.controller.EpubToSimpleController;
import com.glfx.utils.FileUtils;
import com.glfx.utils.SimpleConvertUtils;
import com.glfx.utils.StringUtils;
import nl.siegmann.epublib.domain.*;
import nl.siegmann.epublib.epub.EpubReader;
import nl.siegmann.epublib.epub.EpubWriter;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;
import org.jsoup.select.Elements;

import java.io.*;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;

public class EpubNovelToolMain {

    public static void main(String[] args) throws Exception {
        //小说资源位置
        String novelPath = "F:\\lightNovel\\";
        List<String> fileUrlList = FileUtils.getFileUrlList(novelPath, "epub");
        fileUrlList = fileUrlList.stream().filter(s -> !ZhConverterUtil.isSimple(s) && !s.contains("简体版")).collect(Collectors.toList());
        for (String path : fileUrlList) {
            EpubToSimpleController.toSimple(path);
        }

    }
}
